#pragma once

namespace krryn{
namespace view{ class model; }
namespace animation{
	class skeleton;
	class expression;

	class expression_tree{
	public:
		expression_tree(view::model &a_Model);

		// These functions manage temporal skeleton data
		// so that the expression_tree nodes don't have
		// to allocate extra data.
		skeleton *request_scratch_skeleton() const { return m_Scratch; }
		void return_scratch_skeleton(skeleton *a_Skeleton) {}

		skeleton *get_result() const { return m_Result; }

		void update(float a_DT);

		view::model &get_model() const { return m_Model; }
		expression *get_root() const { return m_Root; }
	private:
		view::model &m_Model;
		expression *m_Root;
		skeleton *m_Result;
		skeleton *m_Scratch;
	};
}
}